/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-30
 * Time: 21:25
 */
public class Demo3 {
    public static void main(String[] args) {
        Object locker1=new Object();
        Object locker2=new Object();
        Thread t1=new Thread(()->{
            synchronized (locker1){
                synchronized (locker2){
                    System.out.println(" t1获得了两把锁");
                }
            }

        });
        Thread t2=new Thread(()->{
            synchronized (locker1){
                synchronized (locker2){
                    System.out.println(" t2获得了两把锁");
                }
            }

        });
        t1.start();
        t2.start();

    }
}
